#include<iostream>
using namespace std;
bool st[110][110];
int n, m;
int main()
{
	
	int t;
	cin >> n >> m;
	cin >> t;
	int ans = 0;
	while (t--) {
		int x1, x2, y1, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		for (int i = x1; i <= x2; i++) {
			for (int j = y1; j <= y2; j++) {
				st[i][j] = 1;
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			ans += st[i][j];
		}
	}
	cout << n * m - ans << endl;
	return 0;
}